#include "MTriangle.hpp"

MTriangle::MTriangle(const MTriangle& triangle)
{
	m_vertexA = triangle.getVertexA();
	m_vertexB = triangle.getVertexB();
	m_vertexC = triangle.getVertexC();
}

MTriangle::MTriangle(MVector2D vA, MVector2D vB, MVector2D vC)
{
	m_vertexA = vA;
	m_vertexB = vB;
	m_vertexC = vC;
}

const MVector2D& MTriangle::getVertexA() const
{
	return m_vertexA;
}

const MVector2D& MTriangle::getVertexB() const
{
	return m_vertexB;
}

const MVector2D& MTriangle::getVertexC() const
{
	return m_vertexC;
}

MVector2D MTriangle::getCenter() const
{
	MVector2D center = (m_vertexA + m_vertexB + m_vertexC)/3.0f;

	return center;
}

void MTriangle::setVertexA(const MVector2D &vA)
{
	m_vertexA = vA;
}

void MTriangle::setVertexB(const MVector2D &vB)
{
	m_vertexB = vB;
}

void MTriangle::setVertexC(const MVector2D &vC)
{
	m_vertexC = vC;
}

void MTriangle::reset()
{
	m_vertexA.set(0.0, 0.0);
	m_vertexB.set(0.0, 0.0);
	m_vertexC.set(0.0, 0.0);
}

//EOF
